package com.freemyleft.left.left_app.mian.index.work.allcourses;

import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.widget.TextView;

import com.freemyleft.left.left_app.R;
import com.freemyleft.left.left_app.R2;
import com.freemyleft.left.left_app.mian.index.work.allcourses.adapter.CourserAdapter;
import com.freemyleft.left.left_app.mian.index.work.allcourses.adapter.CourserConvert;
import com.freemyleft.left.zapp.delegates.LeftDelegate;
import com.freemyleft.left.zapp.ui.PickerViewUtils;
import com.freemyleft.left.zapp.ui.recycler.MultipleItemEntity;

import java.util.ArrayList;

import butterknife.BindView;
import butterknife.OnClick;

/**
 * 总课表
 */
public class AllCoursesDelegate extends LeftDelegate {
    @BindView(R2.id.recy)
    RecyclerView recyclerView;
    @BindView(R2.id.tv_yaer)
    TextView yaer;
    @BindView(R2.id.tv_month)
    TextView momth;

    @OnClick(R2.id.tv_month)
    void onClickMonth() {
    }

    @OnClick(R2.id.tv_yaer)
    void onClickYaer() {

    }

    @Override
    public Object setLayout() {
        return R.layout.delegate_work_all_courses;
    }

    @Override
    public void onBindView(@Nullable Bundle savedInstanceState, @NonNull View rootView) {
        initData();
    }

    private void initData() {
        ArrayList<MultipleItemEntity> data = new CourserConvert().convert();
        CourserAdapter adapter = new CourserAdapter(data);
        LinearLayoutManager manager = new LinearLayoutManager(getContext());
        manager.setOrientation(LinearLayoutManager.VERTICAL);
        recyclerView.setAdapter(adapter);
        recyclerView.setLayoutManager(manager);
    }

}
